<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CustomerTypeForm.aspx.cs" Inherits="Sample.CustomerTypeForm" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Customer Type</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <table>
        
        <tr>
            <td>Customer Type Name</td>
            <td>:</td>
            <td>
                <% if(GetDisplayType == Sample.CustomerTypeForm.DisplayType.Add) { %>
                <asp:TextBox ID="CustomerTypeCustomerTypeNameInput" runat="server" MaxLength="50"></asp:TextBox>
      <asp:RequiredFieldValidator ID="CustomerTypeCustomerTypeNameRequiredValidator" runat="server" ErrorMessage="This field is required" ControlToValidate="CustomerTypeCustomerTypeNameInput"></asp:RequiredFieldValidator>
                <% } else { %>
                <asp:Label ID="CustomerTypeCustomerTypeNameDisplay" runat="server" Text=""></asp:Label>
                <% } %>
            </td>
        </tr>
        
        <tr>
            <td>Is Active</td>
            <td>:</td>
            <td>
                <% if(GetDisplayType == Sample.CustomerTypeForm.DisplayType.Add) { %>
                <asp:CheckBox ID="CustomerTypeIsActiveInput" runat="server" Checked="true" />
                <% } else { %>
                <asp:CheckBox ID="CustomerTypeIsActiveDisplay" runat="server" Enabled="false" />
                <% } %>
            </td>
        </tr>
        
        <tr>
            <td colspan="3">
                <asp:GridView ID="CustomerTypeLineGrid" runat="server" AutoGenerateColumns="false" 
                    ShowFooter="false" DataKeyNames="Id">
                <Columns>
                    <asp:BoundField DataField="Id" ItemStyle-CssClass="HideElement"
                        HeaderStyle-CssClass="HideElement" FooterStyle-CssClass="HideElement" />
                    <asp:TemplateField>
                        <ItemTemplate><%# Container.DataItemIndex + 1 %></ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <HeaderTemplate>Customer Name</HeaderTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="CustomerCustomerNameInput" runat="server" MaxLength="50"></asp:TextBox>
      <asp:RequiredFieldValidator ID="CustomerCustomerNameRequiredValidator" runat="server" ErrorMessage="This field is required" ControlToValidate="CustomerCustomerNameInput"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# Eval("CustomerName") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField>
                        <HeaderTemplate>Customer Description</HeaderTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="CustomerCustomerDescriptionInput" runat="server" MaxLength="0"></asp:TextBox>
      
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# Eval("CustomerDescription") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                </asp:GridView>
                
                    <asp:TemplateField>
                        <HeaderTemplate>Customer Name</HeaderTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="CustomerCustomerNameInput" runat="server" MaxLength="50"></asp:TextBox>
      <asp:RequiredFieldValidator ID="CustomerCustomerNameRequiredValidator" runat="server" ErrorMessage="This field is required" ControlToValidate="CustomerCustomerNameInput"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# Eval("CustomerName") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                    <asp:TemplateField>
                        <HeaderTemplate>Customer Description</HeaderTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="CustomerCustomerDescriptionInput" runat="server" MaxLength="0"></asp:TextBox>
      
                        </EditItemTemplate>
                        <ItemTemplate>
                            <%# Eval("CustomerDescription") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
            </td>
        </tr>
        
        <tr>
            <td colspan="3">
                <asp:Button ID="CustomerTypeSaveButton" runat="server" Text="Save" OnClick="CustomerTypeSaveButton_Click" />
                <asp:Button ID="CustomerTypeCancelButton" runat="server" Text="Cancel" OnClick="CustomerTypeCancelButton_Click" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>